<?php
use backend\assets\AgentAsset;
use yii\helpers\Html;
use yii\helpers\Url;
use yii\widgets\LinkPager;

AgentAsset::register($this);
?>

<div class="mg20-y" style="padding-left: 16px;">
    <form action="<?=Url::toRoute(['financial/cashier']) ?>" method="get">
        <input class="lh45 mr20" type="text" placeholder="会员名称" style="width: 224px;height: 42px;line-height: 42px;" name="name" value="<?=Yii::$app->request->get('name')?>"/>
        <span class="btnBg " style=" height: 40px;">
			<input type="submit"  value="搜索" style="height: 40px;line-height: 40px; background: 0; border: 0; "/>
        </span>
    </form>
</div>
<div class="row">
    <?php if(empty($list)){?>
    <table class="table table-bordered">
        <thead>
        <tr>
            <th>会员名称</th>
            <th>日期</th>
            <th>欠款</th>
            <th>产品/服务名称</th>
            <th>已付</th>
            <th>总价</th>
        </tr>
        </thead>
        <tbody>
        <tr>
            <td colspan="6" align="center"><img src="<?=Yii::getAlias('@web/backend/img/nodata.gif');?>"></td>
        </tr>
        </tbody>
    </table>
    <?php }else{?>
    <table class="table table-bordered">
        <thead>
            <tr>
                <th>会员名称</th>
                <th>日期</th>
                <th>欠款</th>
                <th>产品/服务名称</th>
                <th>已付</th>
                <th>总价</th>
            </tr>
        </thead>

        <tbody>
        	<?php foreach ($list as $r):?>
            <tr class="add" dtitle="欠款结算" durl="<?=Url::toRoute(['financial/cashier','action'=>'arrears','id'=>$r['debt_id']])?>" style="cursor: pointer">
                <td><?=Html::encode($r['member_name'])?></td>
                <td><?=Html::encode($r['debt_time'])?></td>
                <td><?=Html::encode($r['debt_count'])?></td>
                <td><?=Html::encode($r['debt_name'])?></td>
                <td><?=Html::encode($r['already_paid'])?></td>
                <td><?=Html::encode($r['total_count'])?></td>
            </tr>
            <?php endforeach;?>
        </tbody>
    </table>
    <?php }?>
    <div class="page" style="text-align:center;">
					<?=LinkPager::widget([
					    'pagination' => $page,
						'firstPageLabel' => '首页',
						'nextPageLabel' => '下一页',
						'prevPageLabel' => '上一页',
						'lastPageLabel' => '末页',
					    'hideOnSinglePage'=>false
					]); ?>
    </div>

</div>
<?php $this->registerJsFile("@web/system/financial/refund/arrearslist.js",['position'=>$this::POS_END]);?>